<!DOCTYPE html>
<!--[if IE 9 ]><html class="ie9"><![endif]-->
<html lang="en">

	<head>
		<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0" />
		<meta name="format-detection" content="telephone=no">
		<meta charset="UTF-8">

		<meta name="description" content="Violate Responsive Admin Template">
		<meta name="keywords" content="Super Admin, Admin, Template, Bootstrap">

		<title>车险单</title>
		<!--
            	作者：offline
            	时间：2018-10-24
            	描述：css文本样式
            -->
		<link href="statics/css/bootstrap.min.css" rel="stylesheet">
		<link rel="stylesheet" href="statics/css/bootstrap-datetimepicker.css">
		<link href="statics/css/animate.min.css" rel="stylesheet">
		<link href="statics/css/font-awesome.min.css" rel="stylesheet">
		<link href="statics/css/form.css" rel="stylesheet">
		<link href="statics/css/calendar.css" rel="stylesheet">
		<link href="statics/css/style2.css" rel="stylesheet">
		<link href="statics/css/icons.css" rel="stylesheet">
		<link href="statics/css/generics.css" rel="stylesheet">
		<link href="statics/css/fsh/fenye.css" rel="stylesheet">
	</head>

	<body id="skin-blur-violate">


			<div class="container">
				<form action="inslist3" method="get">
					<h4 class="page-header">车险单查询</h4>
					<div class="form-inline">
						<label for="insuranceCompany">保险公司</label><input type="text" class="form-control" name="insuranceCompany" id="insuranceCompany">
						<label for="customerName">客户名称</label><input type="text" class="form-control" name="customerName" id="customerName">
						<label >状态</label>
						<select class="form-control" name="registrationStatus">
							<option value="">全部</option>
							<option value="结清">结清</option>
							<option value="新建">新建</option>

						</select>
						<!-- <label for="vin">VIN</label><input type="text" class="form-control" name="vin" id="vin">
        <label for="carPlateNo">车牌号</label><input type="text" class="form-control" name="carPlateNo" id="carPlateNo">-->
					</div>
					
		 <div class="form-inline">
        
<!--<label for="openingTime1">生效日期</label><input type="text" class="form-control  date form_datetime
        input-group" data-date-format="dd-MM-yyyy" readonly name="effectiveTime" id="openingTime1"><span>失效日期</span>
        <input type="text" class="form-control form-control  date form_datetime "
               data-date-format="dd-MM-yyyy" readonly name="invalidTime">-->
        
        <label for="insuranceSheetNo">车险单号</label>
        <input type="text" class="form-control " name="insuranceSheetNo" id="insuranceSheetNo">
    </div>
					<!--  <div class="form-inline">
        <label>订单状态</label><input type="text" class="form-control">
    </div>-->
					<div><button class="btn btn-default col-md-offset-4" type="submit">查询</button><button class="btn btn-info col-md-offset-1" type="reset">重置</button></div>
				</form>
			</div>

			<div class="container">

				<button class="btn btn-primary btn-lg" data-toggle="modal" data-target="#myModal">新增</button>
				<br>
				<!--<div class="main">-->
				<table class="table table-striped table-bordered table-hover table-condensed table-responsive">
					<tr class="success">
						<th>序号</th>
						<th>操作</th>
						<th>车险单号</th>
						<th>登记状态</th>
						<th>手续费用</th>
						<th>保险公司</th>
						<th>生效日期</th>
						<th>失效日期</th>
                        <th>订单状态</th>
						<th>客户</th>
						<th>经办业务员</th>

					</tr>
                    <tbody id="content_page">
					<#list list as insuranceSheet>
						<tr class="success">
							<td style="background: #000000;"> ${(insuranceSheet_index)+1}</td>
							<td style="background: #000000;">
								<button class="btn btn-info" onclick="javascript:showEquipmentDetail(${insuranceSheet.insuranceSheetNo})">修改</button>
								<a class="btn btn-info"  href="del?insuranceSheetNo=${insuranceSheet.insuranceSheetNo}">删除</a></td>
							<td style="background: #000000;">${insuranceSheet.insuranceSheetNo}</td>
							<td style="background: #000000;">${insuranceSheet.registrationStatus}</td>
							<td style="background: #000000;">${insuranceSheet.handlingFee}</td>
							<td style="background: #000000;">${insuranceSheet.insuranceCompany}</td>
							<td style="background: #000000;">${insuranceSheet.effectiveTime}</td>
							<td style="background: #000000;">${insuranceSheet.invalidTime}</td>
							<td style="background: #000000;" class="inss" >${insuranceSheet.insuranceSheetState}</td>
							<td style="background: #000000;">${insuranceSheet.customer.customerName}</td>
							<td style="background: #000000;">${insuranceSheet.employee.employeeId}</td>

						</tr>

					</#list>
					</tbody>
				</table>
					<div id="wrap" class="page_btn clear"></div>
				<!--</div>-->

				<!--<div class=" center-block">
					<button class="btn-info col-sm-1">首页</button>
					<button class="btn-info col-sm-1">上一页</button>
					<button class="btn-info col-sm-1">下一页</button>
					<button class="btn-info col-sm-1">末页</button>
					<span class="col-sm-1"></span></div>
			</div>-->
          
			<!--弹层添加车险单-->
			
   <div class="modal fade " id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true" data-backdrop="static">
     <div class="modal-dialog" style="width: 1000px">
        <div class="modal-content">
            <div class="modal-header >
        
               <button type="button"  class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
        
            <h4 class="modal-title" id="myModalLabel">车险单信息录入</h4>
        </div>
        
        <div class="modal-body ">

           
            <div>
                <form class="form-horizontal" action="addInsur" method="post" name="fileForm">
                    
                    <h3 class="page-header">车险信息</h3>

                    <div class="form-inline">
                        
                        <table class="table-responsive " style="border-collapse: separate;border-spacing:0 5px ">
                            <tr>
                               
                                <td><label>客户编号</label></td>
                                <td><input type="text" class="form-control" ></td>

                                <td style="padding-left: 30px"><label>车险单编号</label></td>
                                <td><input type="text" class="form-control" name="insuranceSheetNo" value="${insuranceSheetNo1}" readonly></td>

                                <td style="padding-left: 30px"><label>经办业务员</label></td>
                                <td><input type="text" id="employeeName2" class="form-control" name="employeeName">
									<span id="nameDiv2">*</span>
								</td>

                            </tr>
                            <tr>

                                <td><label>投险公司</label></td>
                                <td><input type="text" id="insuranceCompany2" class="form-control" name="insuranceCompany">
									<span id="nameDiv3">*</span>
								</td>

                                <td style="padding-left: 30px"><label>登记状态</label>
                                	  
                                </td>
                              <td><select class="form-control" name="registrationStatus" style="width: 70px">
							<option value="结清" >结清</option>
							<option value="新建">新建</option>

						    </select></td>

                                <td style="padding-left: 30px">客户</td>
                                <td><input type="text" id="customerName2" class="form-control" name="customerName">
									<span id="nameDiv4">*</span>
								</td>
                            </tr>

                            <tr>

                                <td><label>生效日期</label></td>
                                <td ><input type="text" class="form-control  date form_datetime
        input-group" data-date-format="dd-MM-yyyy" readonly  id="openingTime3" name="effectiveTime"></td>
                                 <!--name="openingTime3"-->
                                <td style="padding-left: 30px"><label>失效日期</label></td>
                                <td><input type="text" class="form-control  date form_datetime
        input-group" data-date-format="dd-MM-yyyy" readonly  id="openingTime4" name="invalidTime"></td>

                                <td style="padding-left: 30px"><label>手续费</label></td>
                                <td><input type="text" id="handlingFee2" class="form-control" name="handlingFee"></td>
                            </tr>
                            <tr>

								<td style="padding-left: 30px"><label>性别</label>

								</td>
								<td><select class="form-control" name="customerSex">
									<option value="男">男</option>
									<option value="女">女</option>

								</select></td>

                                <td style="padding-left: 30px"><label>身份证</label></td>
                                <td><input type="text" id="customerCardId2" class="form-control" name="customerCardId">
									<span id="nameDiv5">*</span>
								</td>

                                
                                <td style="padding-left: 30px"><label>联系电话</label></td>
                                <td><input type="text" id="customerTel2" class="form-control" name="customerTel"></td>
                            </tr>
                           <tr>
							   <td style="padding-left: 30px"><label>住址</label></td>
							   <td><input type="text" id="customerAddress2" class="form-control" name="customerAddress"></td>
							   <td style="padding-left: 30px"><label>车辆品牌</label></td>
							   <td><input type="text" id="brand2" class="form-control" name="brand"></td>
							   <td style="padding-left: 30px"><label>车系</label></td>
							   <td><input type="text" id="series2" class="form-control" name="series"></td>

						   </tr>
							<tr>
								<td style="padding-left: 30px"><label>车型</label></td>
								<td><input type="text" class="form-control" name="model"></td>
								<td style="padding-left: 30px"><label>vin</label></td>
								<td><input type="text" class="form-control" name="vin"></td>
								<td style="padding-left: 30px"><label></label></td>
								<td></td>

							</tr>


                        </table>


                    </div>


                </form>
            </div>
           
            <hr>
           
          
        </div>
        <div class="modal-footer">
            <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
           
            <button type="button" class="btn btn-primary" onclick="submitBtnClick()">提交</button>
        </div>
      </div><!-- /.modal-content -->
     </div><!-- /.modal -->
</div>
<!--修改弹层-->
			<div class="modal myModal2" id="updatemodal"><!---->
				<div class="modal-dialog modal-lg"><!--还有modal-sm，modal-md-->
					<form action="changeinsuranceSheetVo" method="post">
					<div class="modal-content">
						<div class="modal-header">
							<button class="close" data-dismiss="modal">×</button>
							<h4>修改车险单</h4>
						</div>

						<div class="modal-body">
							<table>
								<tr>
									<td style="padding-left: 30px"><label>车险单号</label></td>
									<td><input type="text" class="form-control" name="insuranceSheetNo" id="insuranceSheetNo1" readonly></td>
									<td style="padding-left: 30px"><label>登记状态</label></td>
									<td>

										<select class="form-control" name="registrationStatus"id="registrationStatus1">

											<option value="结清">结清</option>
											<option value="新建">新建</option>

										</select>
										</td>

									<td style="padding-left: 30px"><label>手续费用</label></td>
									<td><input type="text" class="form-control" name="handlingFee" id="handlingFee1"></td>
								</tr>
								<tr>
									<td style="padding-left: 30px"><label>保险公司</label></td>
									<td><input type="text" class="form-control" name="insuranceCompany"id="insuranceCompany1"></td>
									<td><label>生效日期</label></td>
									<td ><input type="text" class="form-control  date form_datetime
        input-group" data-date-format="dd-MM-yyyy" readonly  id="openingTime5" name="effectiveTime1"></td>
									<!--name="openingTime3"-->
									<td style="padding-left: 30px"><label>失效日期</label></td>
									<td><input type="text" class="form-control  date form_datetime
        input-group" data-date-format="dd-MM-yyyy" readonly  id="openingTime6" name="invalidTime1"></td>
								</tr>
								<tr>
									<td style="padding-left: 30px"><label></label></td>
									<td></td>
									<td style="padding-left: 30px"><label>经办业务员</label></td>
									<td><input type="text" class="form-control" name="employeeId2" id="employeeId1" readonly></td>
									<td style="padding-left: 30px"><label>客户名称</label></td>
									<td><input type="text" class="form-control" name="customerName"id="customerName1"></td>
								</tr>
							</table>
						</div>
						<div class="modal-footer">
							<button class="btn btn-primary" data-dismiss="modal">关闭</button>
							<button  type="submit" class="btn btn-primary" >提交修改</button>
						</div>
					</div>
					</form>
				</div>
			</div>
		
   
       
       <!--ss-->
        
        <!-- Javascript Libraries -->
        
        <!-- jQuery -->
        
        <script src="statics/js/jquery.min.js "></script> <!-- jQuery Library -->

        <!-- Bootstrap -->
        
        <script src="statics/js/bootstrap.min.js "></script>
        <script type="text/javascript" src="statics/js/bootstrap-datetimepicker.js"></script>
        <script type="text/javascript" src="statics/js/bootstrap-datetimepicker.zh-CN.js"></script>
        <!-- UX -->
        
        <script src="statics/js/scroll.min.js "></script> <!-- Custom Scrollbar -->
        
        <!-- Other -->
        
        
        <script src="statics/js/calendar.min.js "></script> <!-- Calendar -->
        <script src="statics/js/feeds.min.js "></script> <!-- News Feeds -->
        
        <!---->
        
        <!-- All JS functions -->
        <script src="statics/js/functions.js "></script>
        
        <!--伪分页-->
			<script src="statics/js/fsh/fenye.js"></script>
        <script>
        	
        	
        		//初始化标签，配置日期格式插件相关参数
        		
    $(function() {
        $(".form_datetime").datetimepicker({
            format : 'yyyy-mm-dd',
            minView : 'month',
            language : 'zh-CN',
            autoclose : true,//选中自动关闭
            startDate : '1900-01-01',
            todayBtn : true
            //显示今日按钮
        });
    });
                function submitBtnClick(){
                    document.fileForm.submit();
                }

                //设置详情按键的事件
                function showEquipmentDetail(insuranceSheetNo) {
                    $.getJSON("getinsDetails", {"insuranceSheetNo": insuranceSheetNo},
                        function (data) {
                            $("#insuranceSheetNo1").val(data.insuranceSheetNo);
                            $("#registrationStatus1").val(data.registrationStatus);
                            $("#handlingFee1").val(data.handlingFee);
                            $("#insuranceCompany1").val(data.insuranceCompany);
                            /*日期转换--时间戳转换日期格式*/
                            var time1= transDate(data.effectiveTime);
                            $("#openingTime5").val(time1);
                            //var time2= new Date(parseInt(data.invalidTime)).toLocaleString().replace(/:\d{1,2}$/,' ');
                            var time2= transDate(data.invalidTime);

                            $("#openingTime6").val(time2);

                            $("#employeeId1").val(data.employeeId);
                            $("#customerName1").val(data.customerName);

                        });
                    $("#updatemodal").modal();


                }
       //提交修改
		/*	function submitBtn(){
                document.fileForm1.submit();
			}*/
        </script>
	<script>
       /*时间戳转换*/
        function transDate(data) {
            var date = new Date(data);
            Y = date.getFullYear() + '-';
            M = ((date.getMonth()+1)<10? '0'+(date.getMonth()+1):date.getMonth()+1) + '-';
            D = date.getDate() + ' ';

            return Y+M+D;

        }
/*非空验证*/




        //验证业务员
        $("#employeeName2").blur(function(){
        var employeeName2=this.value;
        if(employeeName2==null||employeeName2==""){
            $("#nameDiv2").html("业务员不能为空").css("color","red");
        }else{
            $("#nameDiv2").html("√").css("color","green");

        }
    });
//公司名
       //验证公司名
       $("#insuranceCompany2").blur(function(){
           var insuranceCompany2=this.value;
           if(insuranceCompany2==null||insuranceCompany2==""){
               $("#nameDiv3").html("公司名不能为空").css("color","red");
           }else{
               $("#nameDiv3").html("√").css("color","green");

           }
       });



       //验证客户名
       $("#customerName2").blur(function(){
           var customerName2=this.value;
           if(customerName2==null||customerName2==""){
               $("#nameDiv4").html("客户名不能为空").css("color","red");
           }else{
               $("#nameDiv4").html("√").css("color","green");

           }
       });

       //验证身份证
       $("#customerCardId2").blur(function(){
           var reg = /(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/;
           var customerCardId2=this.value;
           if(customerCardId2==null||customerCardId2==""){
               $("#nameDiv5").html("身份证号不能为空").css("color","red");
           }else{
               if(reg.test(customerCardId2) === false)
               {
                   alert("身份证输入不合法");
                   return false;
               }else{


               $("#nameDiv5").html("√").css("color","green");
               }
           }
       });

//根据订单状态判断是否可进行修改操作
 $(function(){
$(".inss").each(function (index) {
    if ($(this).html()=="已审批") {
        $(this).parent().children(":eq(1)").html("无法修改");
    }
})


 });
	</script>




	</body>

</html>